<template>
    <div class="admin">
        <el-tabs tab-position="left">
            <el-tab-pane label="用户管理">
                <User></User>
            </el-tab-pane>
            <el-tab-pane label="文章管理">
                <Infomation></Infomation>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
    import User from "./User"
    import Infomation from "./Infomation"
    export default {
        name: "Admin",
        components: {
            User,
            Infomation
        },
        data() {
            return {
                admin: '',
                userList: []
            }
        },
        created() {
            if(localStorage.getItem("user") != null){
                this.admin = JSON.parse(localStorage.getItem("user"))
                if(this.admin.id != 0){
                    this.$router.push({
                        path:'/error'
                    })
                }
            }else{
                this.$router.push({
                    path:'/error'
                })
            }

        },
        methods: {}
    }
</script>

<style scoped>
    .admin {
        width: 1400px;
        margin: 0 auto;
    }
</style>
